#include "GunnerTower.h"
#include "ResourcesManager.h"

GunnerTower::GunnerTower()
{
    static SDL_Texture* tex_archer = ResourcesManager::Instance().texturePool[ResID::Tex_Gunner];

    static const std::vector<int> idx_list_idle_up = { 4, 5 };
    static const std::vector<int> idx_list_idle_down = { 0, 1 };
    static const std::vector<int> idx_list_idle_left = { 12, 13 };
    static const std::vector<int> idx_list_idle_right = { 8, 9 };
    static const std::vector<int> idx_list_fire_up = { 20, 21, 22, 23 };
    static const std::vector<int> idx_list_fire_down = { 16, 17, 18, 19 };
    static const std::vector<int> idx_list_fire_left = { 28, 29, 30, 31 };
    static const std::vector<int> idx_list_fire_right = { 24, 25, 26, 27 };

    animIdleUp.SetFrameData(tex_archer, 4, 8, idx_list_idle_up);
    animIdleDown.SetFrameData(tex_archer, 4, 8, idx_list_idle_down);
    animIdleLeft.SetFrameData(tex_archer, 4, 8, idx_list_idle_left);
    animIdleRight.SetFrameData(tex_archer, 4, 8, idx_list_idle_right);
    animFireUp.SetFrameData(tex_archer, 4, 8, idx_list_fire_up);
    animFireDown.SetFrameData(tex_archer, 4, 8, idx_list_fire_down);
    animFireLeft.SetFrameData(tex_archer, 4, 8, idx_list_fire_left);
    animFireRight.SetFrameData(tex_archer, 4, 8, idx_list_fire_right);

    size.x = 48, size.y = 48;

    towerType = TowerType::Gunner;

    fireSpeed = 6;
    bulletType = BulletType::Shell;
}
